package com.htl.exampro.question.api;

import com.htl.exampro.base.model.PageResult;
import com.htl.exampro.base.model.ServerResponse;
import com.htl.exampro.question.pojo.query.AnswerPageParam;
import com.htl.exampro.question.pojo.vo.AnswerDetailVO;
import com.htl.exampro.question.pojo.vo.AnswerVO;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * AnswerApi
 *
 * @author hehehe
 * @since 2025-05-25
 */
@FeignClient(name = "exam-pro-question", contextId = "AnswerApi", path = "/question/answer")
public interface AnswerApi {

    @GetMapping("/v1/queryAnswerById")
    ServerResponse<AnswerVO> queryAnswerById(@RequestParam("AnswerId") String answerId);

    @PostMapping("/v1/queryAnswerPage")
    ServerResponse<PageResult<AnswerVO>> queryAnswerPage(@Validated @RequestBody AnswerPageParam pageParam);

    @PostMapping("/v1/saveAnswer")
    ServerResponse<Integer> saveAnswer(@Validated @RequestBody AnswerVO AnswerVO);

    @Operation(summary = "查询答题详情", description = "支持按条件查询答题详情")
    @PostMapping("/v1/queryAnswerDetail")
    ServerResponse<List<AnswerDetailVO>> queryAnswerDetail(@Validated @RequestBody AnswerPageParam pageParam);

}
